<%@ page
	import="com.serviceprovider.business.utility.SecurityContextUser"%>
<%@include file="/WEB-INF/taglibs/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%--@elvariable id="states" type="java.util.List<State>"--%>
<%--@elvariable id="roleList" type="java.util.List<Role>"--%>
<%--@elvariable id="elements" type="com.serviceprovider.business.module.user.model.interfaces.IElements"--%>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><spring:message
	code="${elements.suffix}.edit.user.details.title" /></title>
<link rel="stylesheet" href="<c:url value="/css/styles.css"/>" />
<script src="<c:url value="/javascripts/common.js"/>"
	type="text/javascript"></script>
</head>
<body onload="disableStateField('all');">

<c:if test="<%=SecurityContextUser.isAdmin()%>">
	<%@include file="/WEB-INF/jsp/admin/top_menu.jsp"%>
</c:if>
<c:if test="<%=SecurityContextUser.isServiceProvider()%>">
	<%@include file="/WEB-INF/jsp/serviceprovider/top_menu.jsp"%>
</c:if>
<c:if test="<%=SecurityContextUser.isPayee()%>">
	<%@include file="/WEB-INF/jsp/serviceprovider/top_menu.jsp"%>
</c:if>


<table width=100%>
	<tr>
		<td><%@include file="/WEB-INF/jsp/include/messages.jsp"%>
		<br />
		</td>
	</tr>

</table>
<div class="contentArea"><form:form commandName="userForm"
	action="edit_user_details.htm" method="post" name="editForm">

	<form:hidden path="id" />
	<form:hidden path="currentUser.role.name" />

	<table width=70% class="formTable">

		<tr class="formHeader">
			<td colspan="2" align="left"><b><spring:message
				code="${elements.suffix}.edit.user.details.subtitle" /></b>
		</tr>

		<tr>
			<td colspan="2" align="center"><input type="button"
				onclick="goToSearch()"
				class='ui-button ui-state-default ui-corner-all'
				value="<spring:message code="${elements.suffix}.edit.user.details.cancel"/>" />
			<input type="submit" class='ui-button ui-state-default ui-corner-all'
				value="<spring:message code="${elements.suffix}.edit.user.details.save"/>" />

			</td>
		</tr>
	</table>
	<div id="accordion">
	<h3><a href=#> <spring:message
		code="${elements.suffix}.edit.user.details.account" /> </a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><span style="color: red;">*</span><spring:message
				code="${elements.suffix}.edit.user.details.email" /></td>
			<td><form:input path="email" size="40" maxlength="40" />
			<div class="errors"><form:errors path="email" /></div>
			</td>
		</tr>


		<tr>
			<td>&nbsp;<spring:message
				code="${elements.suffix}.edit.user.details.alternate" /></td>
			<td><form:input path="alternateEmail" size="40" maxlength="40" />
			<div class="errors"><form:errors path="alternateEmail" /></div>
			</td>
		</tr>

		<tr>
			<td align="left" width="175px">
			<div id="roleListComboLabelId"
				style="display: ${elements.roleListComboLabel}"><span
				style="color: red;">*</span><spring:message
				code="${elements.suffix}.edit.user.details.role" /></div>
			</td>
			<td>
			<div id="roleListComboId" style="display: ${elements.roleListCombo}">
			<form:select path="role.id" cssStyle="width: 218px;">
				<c:forEach items="${roleList}" var="item" varStatus="i">
					<form:option value="${item.id}">${item.name}</form:option>
				</c:forEach>
			</form:select></div>
			</td>
		</tr>
		<tr>
			<td>
			<div id="level1UsersComboLabelId"
				style="display: ${elements.level1UsersComboLabel}"><span
				style="color: red;">*</span><spring:message
				code="${elements.suffix}.edit.user.details.level1user" /></div>
			</td>
			<td>
			<div id="level1UsersComboId"
				style="display: ${elements.level1UsersCombo}"><form:select
				path="level1User.id" cssStyle="width: 218px;">
				<form:option value="0">
					<spring:message
						code="${elements.suffix}.edit.user.details.level1None" />
				</form:option>
				<c:forEach items="${level1Users.pageItems}" var="item" varStatus="i">
					<form:option value="${item.id}">${item.firstName} ${item.lastName}</form:option>
				</c:forEach>
			</form:select></div>
			</td>
		</tr>
	</table>
	</div>
	<h3><a href=#> <spring:message
		code="${elements.suffix}.edit.user.details.general" /> </a></h3>

	<div>
	<table width=70% class="formTable">

		<tr>
			<td><span style="color: red;">*</span><spring:message
				code="${elements.suffix}.edit.user.details.firstname" /></td>
			<td><form:input path="firstName" size="40" maxlength="40" />
			<div class="errors"><form:errors path="firstName" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.middlename" /></td>
			<td><form:input path="milddleName" size="40" maxlength="40" /></td>
		</tr>

		<tr>
			<td><span style="color: red;">*</span><spring:message
				code="${elements.suffix}.edit.user.details.lastname" /></td>
			<td><form:input path="lastName" size="40" maxlength="40" />
			<div class="errors"><form:errors path="lastName" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.efin" /></td>
			<td><form:input path="efin" size="40" maxlength="9"
				readonly="true" />
			<div class="errors"><form:errors path="efin" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.ssn" /></td>
			<td><form:input path="ssn" size="40" maxlength="9" />
			<div class="errors"><form:errors path="ssn" /></div>
			</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.ptin" /></td>
			<td><form:input path="ptin" size="40" maxlength="11"
				readonly="true" />
			<div class="errors"><form:errors path="ptin" /></div>
			</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.businessname" /></td>
			<td><form:input path="businessName" size="40" maxlength="40" />
			<div class="errors"><form:errors path="businessName" /></div>
			</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.businessfein" /></td>
			<td><form:input path="businessFein" size="40" maxlength="15" />
			<div class="errors"><form:errors path="businessFein" /></div>
			</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.ownerssn" /></td>
			<td><form:input path="ownerSsn" size="40" maxlength="9" />
			<div class="errors"><form:errors path="ownerSsn" /></div>
			</td>
		</tr>
	</table>
	</div>
	<h3><a href=#> <spring:message
		code="${elements.suffix}.edit.user.details.contactinfo" /></a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress1" /></td>
			<td><form:input path="contactAddress.streetAddress1" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="contactAddress.streetAddress1" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress2" /></td>
			<td><form:input path="contactAddress.streetAddress2" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="contactAddress.streetAddress2" /></div>
			</td>
		</tr>
		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.city" /></td>
			<td><form:input path="contactAddress.city" size="40"
				maxlength="40" />
			<div class="errors"><form:errors path="contactAddress.city" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.state" /></td>
			<td><form:select path="contactAddress.state.code"
				cssStyle="width: 218px;">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${states}" itemValue="code" itemLabel="name" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.country" /></td>
			<td><form:select path="contactAddress.country.code"
				cssStyle="width: 218px;"
				onchange="disableStateField('contactAddress');">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${countries}" itemLabel="name" itemValue="code" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.zip" /></td>
			<td><form:input path="contactAddress.zip" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.firstphone" /></td>
			<td><form:input path="contactAddress.phone" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.fax" /></td>
			<td><form:input path="contactAddress.fax" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.cell" /></td>
			<td><form:input path="contactAddress.cell" size="40"
				maxlength="25" /></td>
		</tr>
	</table>
	</div>

	<h3><a href=#> <spring:message
		code="${elements.suffix}.edit.user.details.businessinfo" /></a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td colspan="2"><input type="radio" name="bsac" value="bsac1"
				id="bsac1" onclick="fillBusinessInfo();" /> <spring:message
				code="${elements.suffix}.edit.user.details.samecontact" /><br />
			<input type="radio" name="bsac" value="bsac2" id="bsac2"
				onclick="fillBusinessInfo();"> <spring:message
				code="${elements.suffix}.edit.user.details.sameshipping" /><br />
			<input type="radio" name="bsac" value="clearB" id="clearB"
				onclick="clearBusinessInfo();"> <spring:message
				code="${elements.suffix}.edit.user.details.samenone" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress1" /></td>
			<td><form:input path="businessAddress.streetAddress1" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="businessAddress.streetAddress1" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress2" /></td>
			<td><form:input path="businessAddress.streetAddress2" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="businessAddress.streetAddress2" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.city" /></td>
			<td><form:input path="businessAddress.city" size="40"
				maxlength="40" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.state" /></td>
			<td><form:select path="businessAddress.state.code"
				cssStyle="width: 218px;">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${states}" itemValue="code" itemLabel="name" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.country" /></td>
			<td><form:select path="businessAddress.country.code"
				cssStyle="width: 218px;"
				onchange="disableStateField('businessAddress');">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${countries}" itemValue="code" itemLabel="name" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.zip" /></td>
			<td><form:input path="businessAddress.zip" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.phone" /></td>
			<td><form:input path="businessAddress.phone" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.fax" /></td>
			<td><form:input path="businessAddress.fax" size="40"
				maxlength="25" /></td>
		</tr>
	</table>
	</div>
	<h3><a href=#><spring:message
		code="${elements.suffix}.edit.user.details.shippinginfo" /></a></h3>
	<div>
	<table width=70% class="formTable">
		<tr>
			<td colspan="2"><input type="radio" name="ssac" value="ssac1"
				id="ssac1" onclick="fillShippingInfo();"> <spring:message
				code="${elements.suffix}.edit.user.details.samecontact" /><br />
			<input type="radio" name="ssac" value="ssac2" id="ssac2"
				onclick="fillShippingInfo();"> <spring:message
				code="${elements.suffix}.edit.user.details.samebusiness" /><br />
			<input type="radio" name="ssac" value="ssacC" id="ssacC"
				onclick="clearShippingInfo();"> <spring:message
				code="${elements.suffix}.edit.user.details.samenone" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress1" /></td>
			<td><form:input path="shippingAddress.streetAddress1" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="shippingAddress.streetAddress1" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.streetAddress2" /></td>
			<td><form:input path="shippingAddress.streetAddress2" size="40"
				maxlength="40" />
			<div class="errors"><form:errors
				path="shippingAddress.streetAddress2" /></div>
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.city" /></td>
			<td><form:input path="shippingAddress.city" size="40"
				maxlength="40" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.state" /></td>
			<td><form:select path="shippingAddress.state.code"
				cssStyle="width: 218px;">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${states}" itemValue="code" itemLabel="name" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.country" /></td>
			<td><form:select path="shippingAddress.country.code"
				cssStyle="width: 218px;"
				onchange="disableStateField('shippingAddress');">
				<form:option value="">
					<spring:message code="${elements.suffix}.edit.user.details.select" />
				</form:option>
				<form:options items="${countries}" itemValue="code" itemLabel="name" />
			</form:select></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.zip" /></td>
			<td><form:input path="shippingAddress.zip" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.phone" /></td>
			<td><form:input path="shippingAddress.phone" size="40"
				maxlength="25" /></td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.fax" /></td>
			<td><form:input path="shippingAddress.fax" size="40"
				maxlength="25" /></td>
		</tr>
	</table>
	</div>
	<h3><a href=#><spring:message
		code="${elements.suffix}.edit.user.details.preferences" /></a></h3>
	<div>
	<table width=70% class="formTable">

		<c:if test="<%=SecurityContextUser.isAdmin()%>">
			<tr id="orderApproval">
				<td><spring:message code="admin.create.user.orderapproval" /></td>
				<td>
				<table border="0" width="50%">
					<tr>
						<td width="50%"><form:radiobutton path="orderApproval"
							value="1" /><spring:message
							code="admin.create.user.orderapproval.auto" /></td>
						<td><form:radiobutton path="orderApproval" value="2" /><spring:message
							code="admin.create.user.orderapproval.manual" /></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr id="checkPrinting">
				<td><spring:message code="admin.create.user.checkprintingby" /></td>
				<td>
				<table border="0" width="50%">
					<tr>
						<td width="50%"><form:radiobutton path="checkPrintingBy"
							value="1" /><spring:message
							code="admin.create.user.checkprintingby.admin" /></td>
						<td><form:radiobutton path="checkPrintingBy" value="2" /><spring:message
							code="admin.create.user.checkprintingby.sp" /></td>
					</tr>
				</table>
				</td>
			</tr>
		</c:if>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.msgnotiftype" /></td>
			<td><form:radiobutton path="prefMessageNotifyType" value="1" />
			<spring:message
				code="${elements.suffix}.edit.user.details.msgnotiftype.email" /><br />
			<form:radiobutton path="prefMessageNotifyType" value="2" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotiftype.text" /><br />
			<form:radiobutton path="prefMessageNotifyType" value="3" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotiftype.both" /><br />
			<form:radiobutton path="prefMessageNotifyType" value="4" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotiftype.none" /><br />
			</td>
		</tr>

		<tr>
			<td><spring:message
				code="${elements.suffix}.edit.user.details.msgnotifalert" /></td>
			<td><form:radiobutton path="prefMessageNotifyAlert" value="1" />
			<spring:message
				code="${elements.suffix}.edit.user.details.msgnotifalert.every" /><br />
			<form:radiobutton path="prefMessageNotifyAlert" value="2" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotifalert.only" /><br />
			<form:radiobutton path="prefMessageNotifyAlert" value="3" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotifalert.when" /><br />
			<form:radiobutton path="prefMessageNotifyAlert" value="4" /> <spring:message
				code="${elements.suffix}.edit.user.details.msgnotifalert.reply" /><br />
			</td>
		</tr>
		<tr>
			<td><br>
			</td>
		</tr>
		</table>
		</div>
		</div>
		<table width=70% class="formTable">
		<tr>
			<td colspan="2" align="center"><input type="button"
				onclick="goToSearch()"
				class='ui-button ui-state-default ui-corner-all'
				value="<spring:message code="${elements.suffix}.edit.user.details.cancel"/>" />
			<input type="submit" class='ui-button ui-state-default ui-corner-all'
				value="<spring:message code="${elements.suffix}.edit.user.details.save"/>" />
			</td>
		</tr>
	</table>
	
	
</form:form> <script language="javascript" type="text/javascript">
	function goToSearch() {
		document.forms[0].action = "search_users.htm";
		document.forms[0].submit();
	}

	function fillBusinessInfo() {

		var chk1 = document.getElementById("bsac1");
		var chk2 = document.getElementById("bsac2");

		if (chk1.checked) {
			document.getElementById("businessAddress.streetAddress1").value = document
					.getElementById("contactAddress.streetAddress1").value;
			document.getElementById("businessAddress.streetAddress2").value = document
					.getElementById("contactAddress.streetAddress2").value;
			document.getElementById("businessAddress.city").value = document
					.getElementById("contactAddress.city").value;
			document.getElementById("businessAddress.state.code").value = document
					.getElementById("contactAddress.state.code").value;
			document.getElementById("businessAddress.state.code").disabled = document
					.getElementById("contactAddress.state.code").disabled;
			document.getElementById("businessAddress.country.code").value = document
					.getElementById("contactAddress.country.code").value;
			document.getElementById("businessAddress.zip").value = document
					.getElementById("contactAddress.zip").value;
			document.getElementById("businessAddress.phone").value = document
					.getElementById("contactAddress.phone").value;
			document.getElementById("businessAddress.fax").value = document
					.getElementById("contactAddress.fax").value;
		} else if (chk2.checked) {
			document.getElementById("businessAddress.streetAddress1").value = document
					.getElementById("shippingAddress.streetAddress1").value;
			document.getElementById("businessAddress.streetAddress2").value = document
					.getElementById("shippingAddress.streetAddress2").value;
			document.getElementById("businessAddress.city").value = document
					.getElementById("shippingAddress.city").value;
			document.getElementById("businessAddress.state.code").value = document
					.getElementById("shippingAddress.state.code").value;
			document.getElementById("businessAddress.state.code").disabled = document
					.getElementById("shippingAddress.state.code").disabled;
			document.getElementById("businessAddress.country.code").value = document
					.getElementById("shippingAddress.country.code").value;
			document.getElementById("businessAddress.zip").value = document
					.getElementById("shippingAddress.zip").value;
			document.getElementById("businessAddress.phone").value = document
					.getElementById("shippingAddress.phone").value;
			document.getElementById("businessAddress.fax").value = document
					.getElementById("shippingAddress.fax").value;
		}
	}

	function clearBusinessInfo() {
		document.getElementById("businessAddress.streetAddress1").value = "";
		document.getElementById("businessAddress.streetAddress2").value = "";
		document.getElementById("businessAddress.city").value = "";
		document.getElementById("businessAddress.zip").value = "";
		document.getElementById("businessAddress.phone").value = "";
		document.getElementById("businessAddress.fax").value = "";
		document.getElementById("businessAddress.state.code").value = "";
		document.getElementById("businessAddress.country.code").value = "";
	}

	function clearShippingInfo() {
		document.getElementById("shippingAddress.streetAddress1").value = "";
		document.getElementById("shippingAddress.streetAddress2").value = "";
		document.getElementById("shippingAddress.city").value = "";
		document.getElementById("shippingAddress.zip").value = "";
		document.getElementById("shippingAddress.phone").value = "";
		document.getElementById("shippingAddress.fax").value = "";
		document.getElementById("shippingAddress.state.code").value = "";
		document.getElementById("shippingAddress.country.code").value = "";
	}

	function fillShippingInfo() {
		var chk1 = document.getElementById("ssac1");
		var chk2 = document.getElementById("ssac2");
		//alert(chk);
		if (chk1.checked) {
			document.getElementById("shippingAddress.streetAddress1").value = document
					.getElementById("contactAddress.streetAddress1").value;
			document.getElementById("shippingAddress.streetAddress2").value = document
					.getElementById("contactAddress.streetAddress2").value;
			document.getElementById("shippingAddress.city").value = document
					.getElementById("contactAddress.city").value;
			document.getElementById("shippingAddress.state.code").value = document
					.getElementById("contactAddress.state.code").value;
			document.getElementById("shippingAddress.state.code").disabled = document
					.getElementById("contactAddress.state.code").disabled;
			document.getElementById("shippingAddress.country.code").value = document
					.getElementById("contactAddress.country.code").value;
			document.getElementById("shippingAddress.zip").value = document
					.getElementById("contactAddress.zip").value;
			document.getElementById("shippingAddress.phone").value = document
					.getElementById("contactAddress.phone").value;
			document.getElementById("shippingAddress.fax").value = document
					.getElementById("contactAddress.fax").value;
		} else if (chk2.checked) {
			document.getElementById("shippingAddress.streetAddress1").value = document
					.getElementById("businessAddress.streetAddress1").value;
			document.getElementById("shippingAddress.streetAddress2").value = document
					.getElementById("businessAddress.streetAddress2").value;
			document.getElementById("shippingAddress.city").value = document
					.getElementById("businessAddress.city").value;
			document.getElementById("shippingAddress.state.code").value = document
					.getElementById("businessAddress.state.code").value;
			document.getElementById("shippingAddress.state.code").disabled = document
					.getElementById("businessAddress.state.code").disabled;
			document.getElementById("shippingAddress.country.code").value = document
					.getElementById("businessAddress.country.code").value;
			document.getElementById("shippingAddress.zip").value = document
					.getElementById("businessAddress.zip").value;
			document.getElementById("shippingAddress.phone").value = document
					.getElementById("businessAddress.phone").value;
			document.getElementById("shippingAddress.fax").value = document
					.getElementById("businessAddress.fax").value;
		}

	}
	function disableStateField(addr) {
		if (addr == "all") {
			disableStateFieldValue("contactAddress", document
					.getElementById("contactAddress.state.code").value);
			disableStateFieldValue("businessAddress", document
					.getElementById("businessAddress.state.code").value);
			disableStateFieldValue("shippingAddress", document
					.getElementById("shippingAddress.state.code").value);
			return;
		}
		disableStateFieldValue(addr, "--");
	}
	function disableStateFieldValue(addr, value) {

		loadOnFirst();
		var country = document.getElementById(addr + ".country.code").value;
		if (country == "USA") {
			document.getElementById(addr + ".state.code").disabled = false;
			document.getElementById(addr + ".state.code").value = value;
		} else {
			document.getElementById(addr + ".state.code").value = "--";
			document.getElementById(addr + ".state.code").disabled = true;
		}
	}
	function disable_EFIN_PTIN_Field() {

		if (document.getElementById("currentUser.role.name").value == "ROLE_ADMINISTRATOR") {

			document.getElementById("ptin").readOnly = false;
			document.getElementById("efin").readOnly = false;
		}
	}
	function loadOnFirst() {
		disable_EFIN_PTIN_Field();
		$("#accordion").accordion();
	}
</script></div><%@include file="/WEB-INF/jsp/include/footer.jsp"%></body>
</html>